﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" Theme="SkinFile"
 AutoEventWireup="true" CodeBehind="FriendlyNT.aspx.cs" Inherits="Nivdal.FriendlyNT" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" runat="server" >
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel ID="MessageUpdatePanel" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Panel ID="MessagePanel" runat="server">
                <asp:Label ID="MessageLabel" runat="server" SkinID="GreenSmallHeaderLabel"></asp:Label>
                <br />
            </asp:Panel>  
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="NationalTeamPanel" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <div class="basic_element">
        <div class="red_title">
          <asp:Label ID="NationalTeamTitleLabel" runat="server" Text="<%$ Resources:Resource, NationalTeam_NationalTeamTitle %>"  CssClass="white_title"></asp:Label>
        </div>
        <div class="padding5">
            <asp:Label ID="FriendlyWeeksTitleLabel" runat="server" SkinID="SubHeaderLabel"
             Text="<%$ Resources:Resource, Friendly_NTSchedule %>"></asp:Label>
             <br />
             <asp:GridView ID="NtScheduleGridview" runat="server" SkinID="Professional" AutoGenerateColumns="false" AllowPaging="false"
              DataSourceID="NTScheduleDataSource">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:Label ID="DateLabel" runat="server" SkinID="GridLabel" Text='<%# Eval("Date") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:Label ID="InfoLabel" runat="server" SkinID="GridLabel" Text='<%# Eval("Title") %>'
                             Visible='<%# Eval("MatchId").ToString() == "0" %>'></asp:Label>
                            <asp:HyperLink ID="MatchLink" runat="server" SkinID="GreenTitleHyperLink" NavigateUrl='<%# "~/MatchPage.aspx?MatchId=" + Eval("MatchId") %>'
                             Text='<%# Eval("Title") %>' Visible='<%# Eval("MatchId").ToString() != "0" %>'></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
             </asp:GridView>

             <asp:SqlDataSource ID="NTScheduleDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                SelectCommand="Nivdal_GetNTTeamFriendlyWeekMatches" SelectCommandType="StoredProcedure">
            </asp:SqlDataSource>
            </div>
         </div>
            <asp:Panel ID="NTIncomingSuggestionsPanel" runat="server">
                <div class="basic_element">
                <div class="red_title">
                    <asp:Label ID="NTIncomingChalangesTitleLabel" runat="server" Text="<%$ Resources:Resource, Friendly_IncomingChallangesTitleLabelText %>" CssClass="white_title"></asp:Label>
                </div>
                <div class="padding5">

                    <asp:GridView ID="NTIncomingSuggestionsGridview" runat="server" DataSourceID="NTChallangesDataSourse"
                        SkinID="Professional" AutoGenerateColumns="false"  AllowPaging="true" PageSize="13" OnRowCommand="IncomingFriendlyRowCommand">
                        <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
                                Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
                            <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
                        <Columns>
                            <asp:TemplateField HeaderText="<%$ Resources:Resource, Global_Date %>" ItemStyle-Width="25%">
                                <ItemTemplate>
                                    <asp:Label ID="DateLabel" runat="server" Text='<%# Eval("Date") %>' SkinID="GridLabel"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="<%$ Resources:Resource, Global_From %>" ItemStyle-Width="45%">
                                <ItemTemplate>
                                    <asp:HyperLink ID="ToTeamHyperlink" runat="server" SkinID="BlackHyperLinkSkin" 
                                    NavigateUrl='<%# "~/NationalTeam.aspx?Id=" + Eval("TeamId") %>' Text='<%# Eval("TeamName") %>'></asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField ItemStyle-Width="10%">
                                <ItemTemplate>
                                    <asp:Label ID="HomeMatchLabel" runat="server" Text="<%$ Resources:Resource, Friendly_HomeMatch %>"
                                     SkinID="GridLabel" Visible='<%# !(bool)Eval("SuggestingTeamHosts") %>'></asp:Label>
                                    <asp:Label ID="AwayMatchLabel" runat="server" Text="<%$ Resources:Resource, Friendly_AwayMatch %>"
                                     SkinID="GridLabel" Visible='<%# Eval("SuggestingTeamHosts") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField ItemStyle-Width="10%">
                                <ItemTemplate>
                                    <asp:Label ID="NormalRulesLabel" runat="server" Text="<%$ Resources:Resource, Friendly_NormalRules %>"
                                     SkinID="GridLabel" Visible='<%# !(bool)Eval("CupRules") %>'></asp:Label>
                                    <asp:Label ID="CupRulesLabel" runat="server" Text="<%$ Resources:Resource, Friendly_CupRules %>"
                                     SkinID="GridLabel" Visible='<%# Eval("CupRules") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField ItemStyle-Width="10%">
                                <ItemTemplate>
                                    <asp:ImageButton ID="AcceptFriendlyImageButton" runat="server" ImageUrl="~/Images/Icons/vi.png"
                                        ToolTip="<%$ Resources:Resource, Friendly_AcceptFriendlyToolTip %>" CommandName="Accept"
                                        CommandArgument='<%# Eval("Id") %>' OnClientClick='<%# AcceptChallangeOnClientClick((string)Eval("TeamName")) %>' />
                                    <asp:ImageButton ID="DeclineFriendlyImageButton" runat="server" ImageUrl="~/Images/Icons/delete.png"
                                        ToolTip="<%$ Resources:Resource, Friendly_DeclineFriendlyToolTip %>" CommandName="Decline"
                                        CommandArgument='<%# Eval("Id") %>' OnClientClick='<%# DeclineChallangeOnClientClick((string)Eval("TeamName")) %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <asp:SqlDataSource ID="NTChallangesDataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                        SelectCommand="Nivdal_FriendlyGetChallangesForUser" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
                
                </div>
                </div>
        
            </asp:Panel>
             <asp:Panel ID="NTOutgoingChallangesPanel" runat="server">
                <div class="basic_element">
                <div class="red_title">
                   <asp:Label ID="NTOutgoingChallangesTitleLabel" runat="server" CssClass="white_title" Text="<%$ Resources:Resource, Friendly_OutgoingChallangesTitleLabelText %>"></asp:Label>
                </div>
                <div class="padding5">

                    <asp:GridView ID="NTOutgoingFriendlyChallangesGridView" runat="server" SkinID="Professional"
                        DataSourceID="NTSuggestionsDataSourse" AllowPaging="true" PageSize="13" AutoGenerateColumns="false"
                        OnRowCommand="WithdrawFriendly">
                        <%--<EmptyDataTemplate>
                            <asp:Label ID="NoOutgoingChallanges" runat="server" Text="<%$ Resources:Resource, Friendly_NoOutgoingChallangesLabelText %>"
                                SkinID="GridLabel"></asp:Label>
                        </EmptyDataTemplate>--%>
                        <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
                            Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
                        <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
                        <Columns>
                            <asp:TemplateField HeaderText="<%$ Resources:Resource, Global_Date %>" ItemStyle-Width="25%">
                                <ItemTemplate>
                                    <asp:Label ID="DateLabel" runat="server" Text='<%# Eval("Date") %>' SkinID="GridLabel"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="<%$ Resources:Resource, Follow_TransferToHeaderTextText %>" ItemStyle-Width="45%">
                                <ItemTemplate>
                                    <asp:HyperLink ID="ChallangedTeamHyperlink" runat="server" SkinID="BlackHyperLinkSkin"
                                        NavigateUrl='<%# "~/NationalTeam.aspx?Id=" + Eval("TeamId") %>' Text='<%# Eval("TeamName") %>'></asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField ItemStyle-Width="10%">
                                <ItemTemplate>
                                    <asp:Label ID="HomeMatchLabel" runat="server" Text="<%$ Resources:Resource, Friendly_HomeMatch %>"
                                     SkinID="GridLabel" Visible='<%# Eval("SuggestingTeamHosts") %>'></asp:Label>
                                    <asp:Label ID="AwayMatchLabel" runat="server" Text="<%$ Resources:Resource, Friendly_AwayMatch %>"
                                     SkinID="GridLabel" Visible='<%# !(bool)Eval("SuggestingTeamHosts") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField ItemStyle-Width="10%">
                                <ItemTemplate>
                                    <asp:Label ID="NormalRulesLabel" runat="server" Text="<%$ Resources:Resource, Friendly_NormalRules %>"
                                     SkinID="GridLabel" Visible='<%# !(bool)Eval("CupRules") %>'></asp:Label>
                                    <asp:Label ID="CupRulesLabel" runat="server" Text="<%$ Resources:Resource, Friendly_CupRules %>"
                                     SkinID="GridLabel" Visible='<%# Eval("CupRules") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField ItemStyle-Width="10%">
                                <ItemTemplate>
                                    <asp:ImageButton ID="DeclineImageButton" runat="server" ImageUrl="~/Images/Icons/delete.png"
                                        OnClientClick='<%# WithdrawChallangeOnClientClick((string)Eval("TeamName")) %>'
                                        CommandArgument='<%# Eval("Id") %>' ToolTip="<%$ Resources:Resource, Friendly_WithdrawFriendlyToolTip %>" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <asp:SqlDataSource ID="NTSuggestionsDataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                        SelectCommand="Nivdal_FriendlyGetSentSuggestionsForUser" SelectCommandType="StoredProcedure">
                    </asp:SqlDataSource>
                </div>
                </div>

             </asp:Panel>
         

    </ContentTemplate>
    </asp:UpdatePanel>

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:Label ID="PageNameLabel" runat="server" Text="<%$ Resources:Resource, Friendly_PageNameLabelText %>"
        CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>
